Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: psmCharter.addInstance interface shape correction #6202

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

Chris-Hibbert
Copy link
Contributor

Description

Correct the interface shape declaration for psmCharter.addInstance(). The last two parameters are optional.

Security Considerations

None

Documentation Considerations

None

Testing Considerations

Exercised by running make scenario2-setup scenario2-run-chain-psm.

The last two parameters are optional.
@Chris-Hibbert Chris-Hibbert added bug Something isn't working wallet Inter-protocol Overarching Inter Protocol pso labels Sep 14, 2022
@Chris-Hibbert Chris-Hibbert added this to the Mainnet 1 RC0 milestone Sep 14, 2022
@Chris-Hibbert Chris-Hibbert self-assigned this Sep 14, 2022
@Chris-Hibbert Chris-Hibbert added the automerge:no-update (expert!) Automatically merge without updates label Sep 14, 2022
@turadg turadg added the bypass:integration Prevent integration tests from running on PR label Sep 14, 2022
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.optional is new to me but if it works for you locally then I believe it.

I added the bypass:integration label. Since the test didn't catch the bug going it it shouldn't be affected by it being fixed ;-)

BrandShape,
).returns(),
addInstance: M.call(InstanceHandleShape, M.any())
.optional(BrandShape, BrandShape)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL .optional. Where is it documented or implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's very little documentation. I dunno where the implementations are. It's tested in test-heap-classes.

Copy link
Member

@turadg turadg Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that documentation doesn't mention optional. I've filed #6206 cc @erights

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #6206 (comment) :

FWIW, this is implemented at

optional: (...optArgGuards) => {
optionalArgGuards === undefined ||
assert.fail(X`Can only have one set of optional guards`);
restArgGuard === undefined ||
assert.fail(X`optional arg guards must come before rest arg`);
return makeMethodGuardMaker(callKind, argGuards, optArgGuards);
},
and used several times in https://github.com/Agoric/agoric-sdk/blob/master/packages/ERTP/src/typeGuards.js

I'm actually surprised I didn't write any comments explaining this at all. I certainly agree it is needed.

Also rest

@Tartuffo Tartuffo removed this from the Mainnet 1 RC0 milestone Sep 14, 2022
@turadg turadg mentioned this pull request Sep 14, 2022
@mergify mergify bot merged commit 9b78628 into master Sep 15, 2022
@mergify mergify bot deleted the fix-psmCharter-addInstace-shape branch September 15, 2022 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates bug Something isn't working bypass:integration Prevent integration tests from running on PR Inter-protocol Overarching Inter Protocol wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants